package Exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        try {
            String line1=null;
            System.out.println(line1.length());
            String line2="";
            System.out.println(line2.charAt(0));
            String line="abc";
            System.out.println(Integer.parseInt(line));

        }catch (NullPointerException e){
            System.out.println("null");
        }catch (StringIndexOutOfBoundsException e){
            System.out.println("String");
        }catch (Exception e){
            System.out.println("finally");
        }
        System.out.println("end");
    }
}
